{
  let arr: (number | string | boolean | null | undefined)[] = [
    1,
    2,
    3,
    'a',
    'b',
    'c',
    true,
    false,
    null,
    undefined,
  ]

  // 类型别名: 专门给类型起别名的
  // 可以使用 type 关键字来定义类型别名
  // type 类型别名名称 = 类型别名
  // typ 自定义类型名 = 复杂的类型 => 简化一些复杂的使用
  type NameArr = (number | string | boolean)[]
  let nameArr: NameArr = ['a', 'b', 'c', 1, 2, 3]
  let nameArr2: NameArr = [1, 2, 3]
  console.log(nameArr)
  console.log(nameArr2)

  type CustomType = number | string | boolean
  let num: CustomType = 1
  let string: CustomType = '1'
  let flag: CustomType = true
  let arr2: CustomType[] = [1, 2, 3, 'a', 'b', 'c']

  type n = number
  type s = string
  type b = boolean
  let num2: n = 1
  let str: s = '1231'
  let boo: b = false

  num2.toFixed(2)
}
